<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href="../../build/common/base.css" rel="stylesheet">

  <link rel="stylesheet" href="../../build/form/form.css">
  <link rel="stylesheet" href="../../build/form/page.css">
  <link rel="stylesheet" href="../../assets/js/common/element/index.css">
  <script type="text/javascript" src="../../build/common/base.js"></script>
  <script type="text/javascript" src="../../build/common/vueEdit.js"></script>
  <script src="../../assets/js/common/element/index.js"></script>
  <style>
    * {
      padding: 0px;
      margin: 0px;
    }

    ul li {
      list-style: none;
    }

    .my_table_box {
      /* display: flex; */
      padding: 10px;
    }

    .link {
      height: 100%;
      width: 8px;
      background-color: #ccc;
    }

    .seek_box {
      padding: 20px;
    }

    .fun_box {
      display: flex;
      /* justify-content: center; */
      margin-bottom: 30px;
      margin-top: 30px;
    }
  </style>
</head>

<body>
  <div id="ctrls">
    <!-- <div class="seek_box">
      <label class="pt5 cell-nowarp overflow-eps fl pr10 lh24 ng-binding">物料编码:</label>
      <input type="text" class="form-control wd180 animated-w" v-model="seek">
      <button @click="seekHand()" class="btn btn-primary">查询</button>
    </div> -->
    
    <div class="my_table_box">
      <div class="fun_box">
        <a @click="handId()" href="jacascript:;" class="btn btn-primary btn-sm mr5 btn-outline">
          <i class="fa fa-edit mr5">
            确定选择
          </i>
        </a>
        <a @click="handCols()" href="jacascript:;" class="btn btn-primary btn-sm mr5 btn-outline">
          <i class="fa fa-edit mr5">
            取消
          </i>
        </a>
      </div>
      <table class="table table-striped table-bordered table_hover text-center mb60">
        <thead>
          <tr>
            <th>选择</th>
            <th>序号</th>
            <th>物料编码</th>
            <th>产品路径1</th>
            <th>产品路径2</th>
            <th>产品路径3</th>
            <th>产品路径4</th>
            <th>产品价格</th>

            <th>产品价格</th>



          </tr>
        </thead>
        <tbody>
          <tr v-for="(item,index) in cailiaoList">
            <th><input v-model="checkedValue" ref="myRadio" name="lx" id="male" type="radio" :value="item.id"></th>
            <td>{{index+1}}</td>
            <td>{{item.wlbm}}</td>
            <td>{{item.产品路径1}}</td>
            <td>{{item.产品路径2}}</td>
            <td>{{item.产品路径3}}</td>
            <td>{{item.产品路径4}}</td>
            <td>{{item.gcjg3}}</td>

          </tr>
        </tbody>
      </table>

    </div>
  </div>
</body>
<script type="text/javascript">
  var vm = new Vue({
    el: "#ctrls",
    data: function () {
      return {
        test: "测试",
        cailiaoList: [],
        seek: "",
        checkedValue: ""
      }
    },
    beforeCreate: function () {
    },
    created: function () {
      var that = this
      var url = Vue.__ctx + "/form/formCustSql/view/list_%E9%A1%B9%E7%9B%AEve%E6%B8%85%E5%8D%95-%E5%8F%98%E6%9B%B4";
      var post = Vue.baseService.post(url, {
        curPage: 1,
        pageSize: 1011,
        params: { "queryData": [{ "name": "wlbm", "con": "like", "val": that.seek }] }
      });
      $.getResultData(post, function (data) {
        console.log("dsadasdasdasd", data)
        that.cailiaoList = data.list
      });
    },
    methods: {
      handCols: function () {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        // parent.location.reload();//刷新父页面，注意一定要在关闭当前iframe层之前执行刷新
        parent.layer.close(index);
      },
      handId: function () {
        var oldid = location.search.replace("?", "")
        console.log("doldid", oldid)
        // var ids = oldid.split(",")
        // var idlv = ids[0]
        // var duibiid = ids[1]
        var newid = this.checkedValue
        var id = oldid + "," + newid
        if (newid == "") {
          $.Dialog.error("请选择");
        } else {
          var that = this
          var url = "http://127.0.0.1:18084/sys/amaterialversion/determine/" + id;
          var post = Vue.baseService.post(url);
          console.log("新Id", id)
          post.then(function (res) {
            $.Toast.success("提交成功")
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.location.reload();//刷新父页面，注意一定要在关闭当前iframe层之前执行刷新
            parent.layer.close(index);
          }, function (status) {
            if (status == !0) {
              $.Toast.error('加载失败！' + status);
            }
          })


        }

        // var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        // parent.location.reload();//刷新父页面，注意一定要在关闭当前iframe层之前执行刷新
        // parent.layer.close(index);
      },
      seekHand: function () {
        var that = this
        var url = Vue.__ctx + "/form/formCustSql/view/list_matestorelist";
        var post = Vue.baseService.post(url, {
          curPage: 1,
          pageSize: 1011,
          params: { "queryData": [{ "name": "wlbm", "con": "like", "val": that.seek }] }
        });
        $.getResultData(post, function (data) {
          console.log("材料板", data)
          // that.veList = data.list
        });
      }

    },

    watch: {

    }
  });
</script>

</html>